package com.youlu.campus.web.sys.po;

import org.apache.commons.lang3.StringUtils;

public enum SysConfigEnum {

    CREATE_ORG_MEMBERS_COUNT("CREATE_ORG_MEMBERS_COUNT", null, "成员数量", "150"),
    ZZ_QUOTA("ZZ_QUOTA", null, "总长名额", "50"),
    DS_QUOTA("DS_QUOTA", null, "大使名额", "200"),
    ROOM_OPEN_ID("ROOM_OPEN_ID", null, "自习室权限", ""),
    INDEX_POPUP("INDEX_POPUP", null, "首页弹窗", ""),
    INTERFACE_LIMIT("INTERFACE_LIMIT", null, "接口限流", ""),
    SIGN_CHECK("SIGN_CHECK", null, "签名校验", ""),
    SIGN_POPUP("SIGN_POPUP", null, "打卡页证书弹窗", ""),
    SIGN_FINISH_POPUP("SIGN_FINISH_POPUP", null, "打卡完成页证书弹窗", ""),
    CIRCULATE_CONFIG("CIRCULATE_CONFIG", null, "志愿者活动配置", ""),
    JD_PRACTICE_CONFIG("JD_PRACTICE_CONFIG", null, "京东实习配置", ""),
    ROBOT_DEFAULT_REPLY_CONFIG("ROBOT_DEFAULT_REPLY_CONFIG", null, "机器人默认自动回复语", ""),
    GJY_CONFIG("GJY_CONFIG", null, "高教云直播配置", "");

    String key;

    String secondKey;

    String desc;

    String defaultValue;

    SysConfigEnum(String key, String secondKey, String desc, String defaultValue) {
        this.key = key;
        this.secondKey = secondKey;
        this.desc = desc;
        this.defaultValue = defaultValue;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getSecondKey() {
        return secondKey;
    }

    public void setSecondKey(String secondKey) {
        this.secondKey = secondKey;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    public static SysConfigEnum getConfigEnumByKey(String key) {
        if (StringUtils.isBlank(key)) {
            return null;
        }
        for (SysConfigEnum configEnum : SysConfigEnum.values()) {
            if (configEnum.getKey().equals(key)) {
                return configEnum;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return key + ":" + secondKey;
    }
}
